//
//  MainTabBarController.m
//  SSC
//
//  Created by 红沙尘 on 17/6/8.
//  Copyright © 2017年 红沙尘. All rights reserved.
//

#import "MainTabBarController.h"
#import "HomeVC.h"
#import "TouzhuVC.h"
#import "WangqiVC.h"
#import "UsercenterVC.h"
#import "AppDelegate.h"
#import "CaiZhongVC.h"
#import "WangqiTabBarController.h"

@interface MainTabBarController ()

@end

@implementation MainTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tabBar.tintColor = COLOR_FF5253;
    self.tabBar.translucent = NO;
    AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;
    
    UINavigationController *homeNav = [app navWithRootViewController:[[HomeVC alloc] init]];
    UINavigationController *tzNav   = [app navWithRootViewController:[[CaiZhongVC alloc] init]];
    UINavigationController *wqNav   = [app navWithRootViewController:[[WangqiTabBarController alloc] init]];
    UINavigationController *ucNav   = [app navWithRootViewController:[[UsercenterVC alloc] init]];
    
    self.viewControllers = @[homeNav,tzNav,wqNav,ucNav];
    
    NSArray *array = @[@"首页",@"投注大厅",@"往期开奖",@"个人中心"];
    
    for (int i = 0; i < self.tabBar.items.count; i ++) {
        UIBarItem *barItem = self.tabBar.items[i];
        barItem.title = array[i];
        NSString *imgNamed = [NSString stringWithFormat:@"TabBarItem%d",i];
        [barItem setImage:LoadImage(imgNamed)];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
